package com.sykj.manage.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sykj.manage.service.BisBagRecordService;
import com.sykj.manage.model.BisBagRecord;
import com.sykj.manage.model.BisBusinessOrder;
import com.sykj.util.ManageBody;
import com.sykj.util.PageUtil;

@Controller
@RequestMapping("bbag")
public class BisBagRecordController {
   @Autowired
   BisBagRecordService bisBagRecordService;
   
   @RequestMapping("/list")
	@ResponseBody
	public ManageBody getBag(BisBagRecord  bisBagRecord,Integer offset,Integer pageSize){
		PageHelper.startPage(offset==null?1:PageUtil.getPageNum(offset, pageSize),pageSize==null?10:pageSize,true);
	   System.out.println("============="+bisBagRecord.getBagtime1());
		List<BisBagRecord> getBag = bisBagRecordService.getBag(bisBagRecord);
		PageInfo<BisBagRecord>pageInfo = new PageInfo<BisBagRecord>(getBag);
	     System.out.println("======================="+bisBagRecord);
		return ManageBody.getData((int)pageInfo.getTotal(),pageInfo.getList(),"");
		
	}
}
